fn largest<T: PartialOrd + Copy>(list: &[T]) -> T {
    let mut larger = list[0];
    for &item in list.iter() {
        if item > larger {
            larger = item;
        }
    }
    return larger;
}

fn main() {
    // 泛型
    let mut numberList = [1, 2, 3, 4, 5, 6];
    let mut maxNum = largest(&numberList);
    println!("最大值: {}", maxNum);
}
